import React, { Component } from "react";
import Search from "./components/Search";
import List from "./components/List";
export default class App extends Component {

  state = {
    users: [], //初始值为数组\
    isFirst: true, //是否为第一次打开页面
    isLoading: false, //标识是否请求中
    err: '', //存储错误请求信息
  }

  updateAppState = (obj) => {
    this.setState(obj)
  }

  render() {
    return (
      <div className="container">
        <Search updateAppState={this.updateAppState}/>
        <List {...this.state}/>
      </div>
    );
  }
}
